package com.highspeed.bdk.gateway.socket.analyze.message.gui.command;

public enum Command {

    OX01((short) 0x01, "查询板卡总信息"),
    OX02((short) 0x02, "查询初始化后网络状态"),
    OX03((short) 0x03, "查询芯片节点"),
    OX05((short) 0x05, "查询物理端口信息"),
    OX07((short) 0x07, "查询板物理链路信息"),
    OX09((short) 0x09, "查询逻辑链路信息"),
    OX0B((short) 0x0B, "查询逻辑端口信息"),
    OX0D((short) 0x0D, "查询物理链路上的逻辑链路"),
    OX0E((short) 0x0E, "查询一条逻辑链路对应的路由表"),
    OX0F((short) 0x0F, "查询逻辑链路下物理链路"),
    OX11((short) 0x11, "查询板卡主备信息"),
    OX12((short) 0x12, "查询所有的逻辑链路对应的物理链路"),
    OX13((short) 0x13, "查询所有逻辑链路"),
    OX14((short) 0x14, "查询所有逻辑链路的路由表"),
    OX15((short) 0x15, "查询多播组"),
    OX17((short) 0x17, "查询一个多播"),
    OX18((short) 0x18, "通过ICD配置和重构"),
    OX19((short) 0x19, "查询APP（组件信息）"),
    OX20((short) 0x20, "读寄存器器"),
    OX21((short) 0x21, "写寄存器器"),
    OX24((short) 0x24, "查询一条逻辑链路上的统计信息"),
    OX27((short) 0x27, "查询一条物理链路统计信息"),
    OX28((short) 0x28, "查询所有物理链路统计信息"),
    OX33((short) 0x33, "下发配置块数据单播逻辑链路"),
    OX34((short) 0x34, "下发配置块数据多播逻辑链路"),
    OX35((short) 0x35, "下发配置消息逻辑链路"),
    OX83((short) 0x83, "下发烧写网络拓扑"),
    OX84((short) 0x84, "下发从flash中读出XML文件命令"),
    OX91((short) 0x91, "查询日志"),
    OXA1((short) 0xA1, "发送连接请求"),
    OXA3((short) 0xA3, "发送退出请求"),
    OXA4((short) 0xA4, "查询告警信息"),
    OX71((short) 0x71, "发送命令行命令");
    /**
     * 命令描述
     */
    private String desc;

    /**
     * 命令值
     */
    private Short cmd;

    private Command(Short cmd, String desc) {
        this.cmd = cmd;
        this.desc = desc;
    }

    public static Command getCommand(short cmd) {
        Command[] commands = Command.values();
        for (Command c : commands) {
            if (c.getCmd() == cmd) {
                return c;
            }
        }
        return null;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Short getCmd() {
        return cmd;
    }

    public void setCmd(Short cmd) {
        this.cmd = cmd;
    }
}
